import { deepCopy } from '../../utils/tool'
const state = {
  isLogin: false,
  userInfo: {}
}

const defaultState = deepCopy(state)

const mutations = {
  RESET_STATE (state) {
    state.userInfo = defaultState.userInfo
  },
  SET_USER (state, user) {
    state.userInfo = { ...user }
    state.isLogin = true
  }
}

const actions = {}

export default {
  state,
  mutations,
  actions
}
